package com.example.admin.controller;

import com.example.admin.pojo.Channel;
import com.example.admin.pojo.request.ChannelRequestParam;
import com.usian.model.admin.pojos.AdChannel;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.common.enums.AppHttpCodeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@RestController
@Api(tags = "频道接口")
@RequestMapping("/api/v1/channel")
public class ChannelController {


    @PostMapping("/add_channel")
    @ApiOperation(value = "新增频道",notes = "新增频道")
    public ResponseResult addChannel(@RequestBody ChannelRequestParam requestParam){

        //return ResponseResult.errorResult(AppHttpCodeEnum.PARAM_REQUIRE_ERROR);
        return ResponseResult.okResult(200,"成功");



    }
    @PostMapping("/list")
    @ApiOperation(value = "所有频道",notes = "所有频道")
    public ResponseResult channelList(){

        //return ResponseResult.errorResult(AppHttpCodeEnum.PARAM_REQUIRE_ERROR);
        //return ResponseResult.okResult(200,"成功");
        List<AdChannel> list = new ArrayList<>();
        AdChannel adChannel = new AdChannel();
        adChannel.setName("JAVA");
       // adChannel.setCreatedTime(new Date());
        adChannel.setIsDefault(false);
        adChannel.setStatus(true);
        adChannel.setId(1);
        adChannel.setOrd(1);
        list.add(adChannel);
        return ResponseResult.okResult(list);



    }
}
